import { commonComponents } from '@/utils/marketConfig'
const market = {
  state: {
    marketConfig: {}
  },
  mutations: {
    setMarketConfig (state, value) {
      state.marketConfig = value
    }
  },
  actions: {
    getCurMarket ({ commit }, key) {
      const idx = key.indexOf('_')
      const code = key.substr(idx + 1)
      commit('setMarketConfig', commonComponents[code])
    }
  }
}

export default market 